/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.quality4spl.fm.cvm.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;

import org.quality4spl.fm.cvm.ConfigDecisionModel;
import org.quality4spl.fm.cvm.ConfigDecisionModelEntry;
import org.quality4spl.fm.cvm.CvmPackage;
import org.quality4spl.fm.cvm.FeatureModelPrototype;
import org.quality4spl.fm.cvm.NamedElement;
import org.quality4spl.fm.cvm.UserAttributeType;
import org.quality4spl.fm.cvm.UserAttributeTypeContext;
import org.quality4spl.fm.cvm.VariabilityModel;
import org.quality4spl.fm.cvm.VariabilityModelEntry;
import org.quality4spl.fm.cvm.VariabilityModelFolder;
import org.quality4spl.fm.cvm.Visibility;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Config Decision Model</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getUserAttributeTypes <em>User Attribute Types</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getParentModel <em>Parent Model</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getParentFolder <em>Parent Folder</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getVisibility <em>Visibility</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getRootEntries <em>Root Entries</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getSourceFeatureModels <em>Source Feature Models</em>}</li>
 *   <li>{@link org.quality4spl.fm.cvm.impl.ConfigDecisionModelImpl#getTargetFeatureModels <em>Target Feature Models</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ConfigDecisionModelImpl extends ConfigDecisionModelElementImpl implements ConfigDecisionModel {
	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDescription()
	 * @generated
	 * @ordered
	 */
	protected static final String DESCRIPTION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDescription()
	 * @generated
	 * @ordered
	 */
	protected String description = DESCRIPTION_EDEFAULT;

	/**
	 * The cached value of the '{@link #getUserAttributeTypes() <em>User Attribute Types</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUserAttributeTypes()
	 * @generated
	 * @ordered
	 */
	protected EList<UserAttributeType> userAttributeTypes;

	/**
	 * The default value of the '{@link #getVisibility() <em>Visibility</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVisibility()
	 * @generated
	 * @ordered
	 */
	protected static final Visibility VISIBILITY_EDEFAULT = Visibility.PUBLIC;

	/**
	 * The cached value of the '{@link #getVisibility() <em>Visibility</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVisibility()
	 * @generated
	 * @ordered
	 */
	protected Visibility visibility = VISIBILITY_EDEFAULT;

	/**
	 * The cached value of the '{@link #getRootEntries() <em>Root Entries</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRootEntries()
	 * @generated
	 * @ordered
	 */
	protected EList<ConfigDecisionModelEntry> rootEntries;

	/**
	 * The cached value of the '{@link #getSourceFeatureModels() <em>Source Feature Models</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSourceFeatureModels()
	 * @generated
	 * @ordered
	 */
	protected EList<FeatureModelPrototype> sourceFeatureModels;

	/**
	 * The cached value of the '{@link #getTargetFeatureModels() <em>Target Feature Models</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTargetFeatureModels()
	 * @generated
	 * @ordered
	 */
	protected EList<FeatureModelPrototype> targetFeatureModels;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ConfigDecisionModelImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CvmPackage.Literals.CONFIG_DECISION_MODEL;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CvmPackage.CONFIG_DECISION_MODEL__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDescription(String newDescription) {
		String oldDescription = description;
		description = newDescription;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION, oldDescription, description));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<UserAttributeType> getUserAttributeTypes() {
		if (userAttributeTypes == null) {
			userAttributeTypes = new EObjectContainmentWithInverseEList<UserAttributeType>(UserAttributeType.class, this, CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES, CvmPackage.USER_ATTRIBUTE_TYPE__CONTEXT);
		}
		return userAttributeTypes;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VariabilityModel getParentModel() {
		if (eContainerFeatureID() != CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL) return null;
		return (VariabilityModel)eContainer();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetParentModel(VariabilityModel newParentModel, NotificationChain msgs) {
		msgs = eBasicSetContainer((InternalEObject)newParentModel, CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL, msgs);
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setParentModel(VariabilityModel newParentModel) {
		if (newParentModel != eInternalContainer() || (eContainerFeatureID() != CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL && newParentModel != null)) {
			if (EcoreUtil.isAncestor(this, newParentModel))
				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
			NotificationChain msgs = null;
			if (eInternalContainer() != null)
				msgs = eBasicRemoveFromContainer(msgs);
			if (newParentModel != null)
				msgs = ((InternalEObject)newParentModel).eInverseAdd(this, CvmPackage.VARIABILITY_MODEL__ROOT_ENTRIES, VariabilityModel.class, msgs);
			msgs = basicSetParentModel(newParentModel, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL, newParentModel, newParentModel));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VariabilityModelFolder getParentFolder() {
		if (eContainerFeatureID() != CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER) return null;
		return (VariabilityModelFolder)eContainer();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetParentFolder(VariabilityModelFolder newParentFolder, NotificationChain msgs) {
		msgs = eBasicSetContainer((InternalEObject)newParentFolder, CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER, msgs);
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setParentFolder(VariabilityModelFolder newParentFolder) {
		if (newParentFolder != eInternalContainer() || (eContainerFeatureID() != CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER && newParentFolder != null)) {
			if (EcoreUtil.isAncestor(this, newParentFolder))
				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
			NotificationChain msgs = null;
			if (eInternalContainer() != null)
				msgs = eBasicRemoveFromContainer(msgs);
			if (newParentFolder != null)
				msgs = ((InternalEObject)newParentFolder).eInverseAdd(this, CvmPackage.VARIABILITY_MODEL_FOLDER__CHILD_ENTRIES, VariabilityModelFolder.class, msgs);
			msgs = basicSetParentFolder(newParentFolder, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER, newParentFolder, newParentFolder));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Visibility getVisibility() {
		return visibility;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVisibility(Visibility newVisibility) {
		Visibility oldVisibility = visibility;
		visibility = newVisibility == null ? VISIBILITY_EDEFAULT : newVisibility;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY, oldVisibility, visibility));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ConfigDecisionModelEntry> getRootEntries() {
		if (rootEntries == null) {
			rootEntries = new EObjectContainmentWithInverseEList<ConfigDecisionModelEntry>(ConfigDecisionModelEntry.class, this, CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES, CvmPackage.CONFIG_DECISION_MODEL_ENTRY__PARENT_MODEL);
		}
		return rootEntries;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<FeatureModelPrototype> getSourceFeatureModels() {
		if (sourceFeatureModels == null) {
			sourceFeatureModels = new EObjectContainmentEList<FeatureModelPrototype>(FeatureModelPrototype.class, this, CvmPackage.CONFIG_DECISION_MODEL__SOURCE_FEATURE_MODELS);
		}
		return sourceFeatureModels;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<FeatureModelPrototype> getTargetFeatureModels() {
		if (targetFeatureModels == null) {
			targetFeatureModels = new EObjectContainmentEList<FeatureModelPrototype>(FeatureModelPrototype.class, this, CvmPackage.CONFIG_DECISION_MODEL__TARGET_FEATURE_MODELS);
		}
		return targetFeatureModels;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getUserAttributeTypes()).basicAdd(otherEnd, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				if (eInternalContainer() != null)
					msgs = eBasicRemoveFromContainer(msgs);
				return basicSetParentModel((VariabilityModel)otherEnd, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				if (eInternalContainer() != null)
					msgs = eBasicRemoveFromContainer(msgs);
				return basicSetParentFolder((VariabilityModelFolder)otherEnd, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getRootEntries()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES:
				return ((InternalEList<?>)getUserAttributeTypes()).basicRemove(otherEnd, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				return basicSetParentModel(null, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				return basicSetParentFolder(null, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES:
				return ((InternalEList<?>)getRootEntries()).basicRemove(otherEnd, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__SOURCE_FEATURE_MODELS:
				return ((InternalEList<?>)getSourceFeatureModels()).basicRemove(otherEnd, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__TARGET_FEATURE_MODELS:
				return ((InternalEList<?>)getTargetFeatureModels()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
		switch (eContainerFeatureID()) {
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				return eInternalContainer().eInverseRemove(this, CvmPackage.VARIABILITY_MODEL__ROOT_ENTRIES, VariabilityModel.class, msgs);
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				return eInternalContainer().eInverseRemove(this, CvmPackage.VARIABILITY_MODEL_FOLDER__CHILD_ENTRIES, VariabilityModelFolder.class, msgs);
		}
		return super.eBasicRemoveFromContainerFeature(msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CvmPackage.CONFIG_DECISION_MODEL__NAME:
				return getName();
			case CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION:
				return getDescription();
			case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES:
				return getUserAttributeTypes();
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				return getParentModel();
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				return getParentFolder();
			case CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY:
				return getVisibility();
			case CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES:
				return getRootEntries();
			case CvmPackage.CONFIG_DECISION_MODEL__SOURCE_FEATURE_MODELS:
				return getSourceFeatureModels();
			case CvmPackage.CONFIG_DECISION_MODEL__TARGET_FEATURE_MODELS:
				return getTargetFeatureModels();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CvmPackage.CONFIG_DECISION_MODEL__NAME:
				setName((String)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION:
				setDescription((String)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES:
				getUserAttributeTypes().clear();
				getUserAttributeTypes().addAll((Collection<? extends UserAttributeType>)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				setParentModel((VariabilityModel)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				setParentFolder((VariabilityModelFolder)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY:
				setVisibility((Visibility)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES:
				getRootEntries().clear();
				getRootEntries().addAll((Collection<? extends ConfigDecisionModelEntry>)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__SOURCE_FEATURE_MODELS:
				getSourceFeatureModels().clear();
				getSourceFeatureModels().addAll((Collection<? extends FeatureModelPrototype>)newValue);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__TARGET_FEATURE_MODELS:
				getTargetFeatureModels().clear();
				getTargetFeatureModels().addAll((Collection<? extends FeatureModelPrototype>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CvmPackage.CONFIG_DECISION_MODEL__NAME:
				setName(NAME_EDEFAULT);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION:
				setDescription(DESCRIPTION_EDEFAULT);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES:
				getUserAttributeTypes().clear();
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				setParentModel((VariabilityModel)null);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				setParentFolder((VariabilityModelFolder)null);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY:
				setVisibility(VISIBILITY_EDEFAULT);
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES:
				getRootEntries().clear();
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__SOURCE_FEATURE_MODELS:
				getSourceFeatureModels().clear();
				return;
			case CvmPackage.CONFIG_DECISION_MODEL__TARGET_FEATURE_MODELS:
				getTargetFeatureModels().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CvmPackage.CONFIG_DECISION_MODEL__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION:
				return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
			case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES:
				return userAttributeTypes != null && !userAttributeTypes.isEmpty();
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL:
				return getParentModel() != null;
			case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER:
				return getParentFolder() != null;
			case CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY:
				return visibility != VISIBILITY_EDEFAULT;
			case CvmPackage.CONFIG_DECISION_MODEL__ROOT_ENTRIES:
				return rootEntries != null && !rootEntries.isEmpty();
			case CvmPackage.CONFIG_DECISION_MODEL__SOURCE_FEATURE_MODELS:
				return sourceFeatureModels != null && !sourceFeatureModels.isEmpty();
			case CvmPackage.CONFIG_DECISION_MODEL__TARGET_FEATURE_MODELS:
				return targetFeatureModels != null && !targetFeatureModels.isEmpty();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
		if (baseClass == NamedElement.class) {
			switch (derivedFeatureID) {
				case CvmPackage.CONFIG_DECISION_MODEL__NAME: return CvmPackage.NAMED_ELEMENT__NAME;
				case CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION: return CvmPackage.NAMED_ELEMENT__DESCRIPTION;
				default: return -1;
			}
		}
		if (baseClass == UserAttributeTypeContext.class) {
			switch (derivedFeatureID) {
				case CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES: return CvmPackage.USER_ATTRIBUTE_TYPE_CONTEXT__USER_ATTRIBUTE_TYPES;
				default: return -1;
			}
		}
		if (baseClass == VariabilityModelEntry.class) {
			switch (derivedFeatureID) {
				case CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL: return CvmPackage.VARIABILITY_MODEL_ENTRY__PARENT_MODEL;
				case CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER: return CvmPackage.VARIABILITY_MODEL_ENTRY__PARENT_FOLDER;
				case CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY: return CvmPackage.VARIABILITY_MODEL_ENTRY__VISIBILITY;
				default: return -1;
			}
		}
		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
		if (baseClass == NamedElement.class) {
			switch (baseFeatureID) {
				case CvmPackage.NAMED_ELEMENT__NAME: return CvmPackage.CONFIG_DECISION_MODEL__NAME;
				case CvmPackage.NAMED_ELEMENT__DESCRIPTION: return CvmPackage.CONFIG_DECISION_MODEL__DESCRIPTION;
				default: return -1;
			}
		}
		if (baseClass == UserAttributeTypeContext.class) {
			switch (baseFeatureID) {
				case CvmPackage.USER_ATTRIBUTE_TYPE_CONTEXT__USER_ATTRIBUTE_TYPES: return CvmPackage.CONFIG_DECISION_MODEL__USER_ATTRIBUTE_TYPES;
				default: return -1;
			}
		}
		if (baseClass == VariabilityModelEntry.class) {
			switch (baseFeatureID) {
				case CvmPackage.VARIABILITY_MODEL_ENTRY__PARENT_MODEL: return CvmPackage.CONFIG_DECISION_MODEL__PARENT_MODEL;
				case CvmPackage.VARIABILITY_MODEL_ENTRY__PARENT_FOLDER: return CvmPackage.CONFIG_DECISION_MODEL__PARENT_FOLDER;
				case CvmPackage.VARIABILITY_MODEL_ENTRY__VISIBILITY: return CvmPackage.CONFIG_DECISION_MODEL__VISIBILITY;
				default: return -1;
			}
		}
		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (name: ");
		result.append(name);
		result.append(", description: ");
		result.append(description);
		result.append(", visibility: ");
		result.append(visibility);
		result.append(')');
		return result.toString();
	}

} //ConfigDecisionModelImpl
